package com.example.xyxwebbackend001.model.DTO;

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class RecPublishDTO {
    @NotBlank(message = "标题不能为空")
    private String title;

    @Pattern(regexp = "^\\d{3,4}$", message = "地点编码应为3-4位数字") // 修改正则表达式
    private String cityId;

    private List<@Valid FoodContentDTO> content = new ArrayList<>();

    @NotNull(message = "封面图不能为空")
    private Cover cover;

    private String articleToken;

    @Data
    public static class Cover {
        @NotBlank(message = "图片路径不能为空")
        private String coverPath;

        @NotBlank(message = "图片类型不能为空")
        private String type;
    }
}
